<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>在浏览器中使用art-template</title>
	</head>
	<body>
		<script src="./node_modules/art-template/lib/template-web.js"></script>
		<!-- 
      模板引擎不需要知道字符串内容，只能认识模板标记语法 {{}}，{{}}mustache语法
     -->
		<script type="text/template" id="temp1">
			<!DOCTYPE html>
			 <html lang="en">
			 <head>
			   <meta charset="UTF-8">
			   <title>Document</title>
			 </head>
			 <body>
			   <p>大家好，我叫：{{ name }}</p>
			   <p>我今年{{ age }}岁了</p>
			   <p>我来自{{ province }}</p>
			   <p>我喜欢：{{each hobbies}} {{ $value }} {{/each}}</p>
			 </body>
			 </html>
		</script>
		<script>
			var ret = template('temp1', {
				name: 'Jack',
				age: 18,
				province: '江西省',
				hobbies: ['写代码', '唱歌', '打游戏'],
			});
			console.log(ret);
		</script>
	</body>
</html>
